package hhh.app.domain.interactor;

import javax.inject.Inject;

import hhh.app.domain.repository.ProductRepository;
import rx.Observable;

/**
 * Created by hhh on 2016/12/13.
 */
public class GetProductDetail extends ProductCase {
    private ProductRepository repository;

    public GetProductDetail setPid(int pid) {
        this.pid = pid;
        return this;
    }

    private int pid;

    @Inject
    public GetProductDetail(ProductRepository repository) {
        this.repository = repository;
    }

    @Override
    protected Observable buildProductCaseSubscriber() {
        return repository.product(pid);
    }
}
